// import axios from 'axios'
// import {get,post} from '@/utils/request'
import request from '@/utils/request'
// axios.baseURL = 'http://127.0.0.1:8080'
// axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'



export function addOrderGood(data) {
  return request({
    url: '/ordergood/add',
    method: 'post',
    data
  })
}

export function getUserAllOrder(query) {
  return request({
    url: '/viewOrder/getByUserId',
    method: 'get',
    params:query
  })
}
export function getOrder(query) {
  return request({
    url: '/order/getByToken',
    method: 'get',
    params:query
  })
}
export function submitOrder(data) {
  return request({
    url: '/order',
    method: 'put',
    data
  })
}
export function couponOrder(data) {
  return request({
    url: '/order',
    method: 'put',
    data
  })
}

export function getOrderGoodList(query) {
  return request({
    url: '/viewOrder/list',
    method: 'get',
    params:query
  })
}
export function deleteOrderGood(query) {
  return request({
    url: '/ordergood',
    method: 'delete',
    params:query
  })
}
export function updateOrderGood(data) {
  return request({
    url: '/ordergood',
    method: 'put',
    data
  })
}
export function getOrderByUserId(query) {
  return request({
    url: '/viewOrder',
    method: 'get',
    params:query
  })
}



// export function changeAddressApi(data) {
//   return request({
//     url: '/addressBook',
//     method: 'put',
//     data
//   })
// }
// export function deleteAddressApi(query) {
//   return request({
//     url: '/addressBook',
//     method: 'delete',
//     params:query
//   })
// }
// export function getAddressApi(token) {
//   return request({
//     url: '/addressBook/list/'+token,
//     method: 'get',
//     // data:token
//   })
// }